import Head from "next/head";
import styles from "./list.module.css";
import { readFile } from "fs";
import { join } from "path";
import { promisify } from "util";
const read = promisify(readFile)
export default function List({data}){
    return <div>
        <Head> <title>list</title> </Head>
        <h2 className={styles.h2}>标题</h2>
        <div>{data}</div>
    </div>
}
export async function getServerSideProps(context){
    console.log(context.query)
    let data = await read(join(process.cwd(),'pages','_app.js'),'utf-8');
    console.log("HELLO")
    return {
        props:{
            data
        }
    }
}